﻿using TimeTravel.XnaLibrary.GamePlay;
namespace TimeTravel.XnaLibrary
{
	/// <summary>
	/// Static class for utility methods.
	/// </summary>
	public static class Utilities
	{
		/// <summary>
		/// Linearly interpolates between two integer values.
		/// </summary>
		/// <param name="value1">The first value.</param>
		/// <param name="value2">The second value.</param>
		/// <param name="amount">The amount of the interpolation. Amount of 0 returns value1, amount of 1 returns value1.</param>
		/// <returns></returns>
		public static int IntegerLepr(int value1, int value2, float amount)
		{
			return value1 + (int)((value2 - value1) * amount);
		}

		/// <summary>
		/// Calculates a factor to randomize with using the static Player.Rng property.
		/// </summary>
		public static float CalculateRandomFactor()
		{
			return (float)Player.Rng.NextDouble() + 0.5f;
		}
	}
}
